/**      
 * @file		BikeStoreRunner.cpp
 * @description		Demonstrates the use of dynamic memory in a data structure.
 * @course		CSCI 123 Section 00000
 * @assignment 
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
#include "BikeStore.h"
using namespace std;

void outputSizeAndCapacity(const BikeStore& aBikeStore);
void addBikes(BikeStore& aBikeStore);
void removeBikes(BikeStore& aBikeStore);

int main() {

	BikeStore laStore;
	cout << "Bike Store created...\n";
	outputSizeAndCapacity(laStore);
	
	Bike truth("Ellsworth Truth", 17, 26.0);
	Bike id("Ellsworth Id", 19, 26.0);
	
	cout << "Adding bikes to the store\n";	
	cout << "Bike added successfully ";
	if(laStore.addBike(truth))
		cout << "true\n";
	else
		cout << "false\n";
	
	cout << "Bike added successfully ";
	if(laStore.addBike(id))
		cout << "true\n";
	else
		cout << "false\n";
	
	outputSizeAndCapacity(laStore);
	
	cout << "Outputting Bike Store:\n" << laStore << endl;
	
	cout << "Adding 10 bikes to the store\n";
	addBikes(laStore);	
	outputSizeAndCapacity(laStore);
	
	cout << "Removing 10 bikes from the store\n";
	removeBikes(laStore);
	outputSizeAndCapacity(laStore);
		
	return 0;

} 

void outputSizeAndCapacity(const BikeStore& aBikeStore) {
	cout << "Bike store size is " << aBikeStore.getSize() << endl;
	cout << "Bike store capacity is " << aBikeStore.getCapacity() << endl;
	cout << endl;
}

void addBikes(BikeStore& aBikeStore) {
	for(int i = 0; i < 10; i++) {
		Bike aBike("Bike "+i, 17, 26.0);
		aBikeStore.addBike(aBike);
	}
}

void removeBikes(BikeStore& aBikeStore) {
	for(int i = 0; i < 10; i++) {
		Bike aBike("Bike "+i, 17, 26.0);
		aBikeStore.removeBike(aBike);
	}
}
